.class public Lcom/permission/runtime/g;
.super Lcom/permission/runtime/i;
.source "PopupDangerousRequest.java"


# instance fields
.field protected d:Landroid/app/Activity;

.field private e:Landroid/app/AlertDialog;

.field private f:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;"
        }
    .end annotation
.end field

.field private g:Lcom/permission/runtime/b;


# direct methods
.method protected constructor <init>(Landroid/app/Activity;Ljava/util/HashMap;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/app/Activity;",
            "Ljava/util/HashMap<",
            "Ljava/lang/String;",
            "Ljava/lang/Integer;",
            ">;)V"
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Lcom/permission/runtime/i;-><init>()V

    .line 2
    iput-object p1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    .line 3
    iput-object p2, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    return-void
.end method

.method static synthetic a(Lcom/permission/runtime/g;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/permission/runtime/g;->c()V

    return-void
.end method

.method private a(Z)V
    .locals 1

    .line 14
    iget-object v0, p0, Lcom/permission/runtime/g;->g:Lcom/permission/runtime/b;

    if-eqz v0, :cond_0

    .line 15
    invoke-virtual {v0, p1}, Lcom/permission/runtime/b;->a(Z)V

    :cond_0
    return-void
.end method

.method static synthetic b(Lcom/permission/runtime/g;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/permission/runtime/g;->d()V

    return-void
.end method

.method private c()V
    .locals 1

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, v0}, Lcom/permission/runtime/g;->a(Z)V

    .line 2
    iget-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    invoke-virtual {v0}, Landroid/app/AlertDialog;->dismiss()V

    return-void
.end method

.method private d()V
    .locals 3

    .line 1
    iget-object v0, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    invoke-virtual {v0}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object v0

    iget-object v1, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    invoke-virtual {v1}, Ljava/util/HashMap;->size()I

    move-result v1

    new-array v1, v1, [Ljava/lang/String;

    invoke-interface {v0, v1}, Ljava/util/Set;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v0

    check-cast v0, [Ljava/lang/String;

    .line 2
    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    invoke-static {v1, v0}, Lcom/permission/runtime/f;->a(Landroid/app/Activity;[Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 3
    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    const/4 v2, 0x1

    invoke-static {v1, v0, v2}, Landroidx/core/app/ActivityCompat;->requestPermissions(Landroid/app/Activity;[Ljava/lang/String;I)V

    goto :goto_0

    .line 4
    :cond_0
    invoke-direct {p0}, Lcom/permission/runtime/g;->e()V

    .line 5
    :goto_0
    iget-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    invoke-virtual {v0}, Landroid/app/AlertDialog;->dismiss()V

    return-void
.end method

.method private e()V
    .locals 4

    .line 1
    new-instance v0, Landroid/content/Intent;

    const-string v1, "android.settings.APPLICATION_DETAILS_SETTINGS"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 2
    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    invoke-virtual {v1}, Landroid/app/Activity;->getPackageName()Ljava/lang/String;

    move-result-object v1

    const-string v2, "package"

    const/4 v3, 0x0

    invoke-static {v2, v1, v3}, Landroid/net/Uri;->fromParts(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    .line 3
    invoke-virtual {v0, v1}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 4
    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    iget v2, p0, Lcom/permission/runtime/i;->c:I

    invoke-virtual {v1, v0, v2}, Landroid/app/Activity;->startActivityForResult(Landroid/content/Intent;I)V

    return-void
.end method

.method private f()V
    .locals 6
    .annotation build Landroid/annotation/TargetApi;
        value = 0x13
    .end annotation

    .line 1
    iget-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    if-nez v0, :cond_2

    .line 2
    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0x15

    if-lt v0, v1, :cond_0

    .line 3
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    const v2, 0x103000f

    invoke-direct {v0, v1, v2}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;I)V

    goto :goto_0

    .line 4
    :cond_0
    new-instance v0, Landroid/app/AlertDialog$Builder;

    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    invoke-direct {v0, v1}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 5
    :goto_0
    iget-object v1, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    invoke-static {v1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v1

    sget v2, Lcom/permission/runtime/m;->dialog_special_permission_ask_rarionale:I

    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 6
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    .line 7
    iget-object v3, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    invoke-virtual {v3}, Ljava/util/HashMap;->entrySet()Ljava/util/Set;

    move-result-object v3

    invoke-interface {v3}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_1

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/Map$Entry;

    .line 8
    iget-object v5, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/lang/Integer;

    invoke-virtual {v4}, Ljava/lang/Integer;->intValue()I

    move-result v4

    invoke-virtual {v5, v4}, Landroid/app/Activity;->getString(I)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_1

    .line 9
    :cond_1
    sget v3, Lcom/permission/runtime/l;->dialog_content:I

    invoke-virtual {v1, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/widget/TextView;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v3, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 10
    invoke-virtual {v0}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    iput-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    .line 11
    invoke-virtual {v0}, Landroid/app/AlertDialog;->show()V

    .line 12
    iget-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    new-instance v2, Lcom/permission/runtime/g$a;

    invoke-direct {v2, p0}, Lcom/permission/runtime/g$a;-><init>(Lcom/permission/runtime/g;)V

    invoke-virtual {v0, v2}, Landroid/app/AlertDialog;->setOnCancelListener(Landroid/content/DialogInterface$OnCancelListener;)V

    .line 13
    iget-object v0, p0, Lcom/permission/runtime/g;->e:Landroid/app/AlertDialog;

    invoke-virtual {v0}, Landroid/app/AlertDialog;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/view/Window;->setContentView(Landroid/view/View;)V

    .line 14
    sget v0, Lcom/permission/runtime/l;->txt_grant:I

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v2, Lcom/permission/runtime/g$b;

    invoke-direct {v2, p0}, Lcom/permission/runtime/g$b;-><init>(Lcom/permission/runtime/g;)V

    invoke-virtual {v0, v2}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 15
    sget v0, Lcom/permission/runtime/l;->txt_cancel:I

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    new-instance v1, Lcom/permission/runtime/g$c;

    invoke-direct {v1, p0}, Lcom/permission/runtime/g$c;-><init>(Lcom/permission/runtime/g;)V

    invoke-virtual {v0, v1}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    goto :goto_2

    .line 16
    :cond_2
    invoke-virtual {v0}, Landroid/app/AlertDialog;->show()V

    :goto_2
    return-void
.end method


# virtual methods
.method public a()V
    .locals 1

    .line 3
    iget-object v0, p0, Lcom/permission/runtime/g;->g:Lcom/permission/runtime/b;

    if-eqz v0, :cond_0

    const/4 v0, 0x0

    .line 4
    iput-object v0, p0, Lcom/permission/runtime/g;->g:Lcom/permission/runtime/b;

    :cond_0
    return-void
.end method

.method public a(Lcom/permission/runtime/b;)V
    .locals 0

    .line 2
    iput-object p1, p0, Lcom/permission/runtime/g;->g:Lcom/permission/runtime/b;

    return-void
.end method

.method public a(IILandroid/content/Intent;)Z
    .locals 2

    .line 9
    iget p2, p0, Lcom/permission/runtime/i;->c:I

    const/4 p3, 0x0

    if-ne p1, p2, :cond_1

    .line 10
    iget-object p1, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    const/4 p2, 0x1

    if-eqz p1, :cond_0

    iget-object v0, p0, Lcom/permission/runtime/g;->d:Landroid/app/Activity;

    .line 11
    invoke-virtual {p1}, Ljava/util/HashMap;->keySet()Ljava/util/Set;

    move-result-object p1

    iget-object v1, p0, Lcom/permission/runtime/g;->f:Ljava/util/HashMap;

    invoke-virtual {v1}, Ljava/util/HashMap;->size()I

    move-result v1

    new-array v1, v1, [Ljava/lang/String;

    invoke-interface {p1, v1}, Ljava/util/Set;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object p1

    check-cast p1, [Ljava/lang/String;

    invoke-static {v0, p1}, Lcom/permission/runtime/f;->a(Landroid/content/Context;[Ljava/lang/String;)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 12
    invoke-direct {p0, p2}, Lcom/permission/runtime/g;->a(Z)V

    goto :goto_0

    .line 13
    :cond_0
    invoke-direct {p0, p3}, Lcom/permission/runtime/g;->a(Z)V

    :goto_0
    return p2

    :cond_1
    return p3
.end method

.method public a(I[Ljava/lang/String;[I)Z
    .locals 0
    .param p2    # [Ljava/lang/String;
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param
    .param p3    # [I
        .annotation build Landroidx/annotation/NonNull;
        .end annotation
    .end param

    .line 5
    invoke-super {p0, p1, p2, p3}, Lcom/permission/runtime/i;->a(I[Ljava/lang/String;[I)Z

    .line 6
    invoke-static {p3}, Lcom/permission/runtime/f;->a([I)Z

    move-result p1

    const/4 p2, 0x1

    if-nez p1, :cond_0

    const/4 p1, 0x0

    .line 7
    invoke-direct {p0, p1}, Lcom/permission/runtime/g;->a(Z)V

    goto :goto_0

    .line 8
    :cond_0
    invoke-direct {p0, p2}, Lcom/permission/runtime/g;->a(Z)V

    :goto_0
    return p2
.end method

.method public b()V
    .locals 0

    .line 2
    invoke-direct {p0}, Lcom/permission/runtime/g;->f()V

    return-void
.end method
